﻿@using WSS.Models.Test
@{
    ViewBag.Title = "试题列表";
}
<div class="container" style="margin-top: 20px">
    <div class="div_Content">
        @*试卷*@
        <div class="page-header">
            <h3 style="text-align: center; font-size: 20px; font-family: 'Microsoft YaHei'; color: #333;">@ViewBag.TestName</h3>
            <input name="TestID" id="TestID" value="@ViewBag.TestID" type="hidden"/>
        </div>
        @*试题分类*@
        <div class="div_content_header" style="line-height: 1px">
            <ul class="list-inline" style="margin-bottom: 0">
                @if (ViewBag.QCateList != null)
                {
                    int i = 0;
                    List<StrObjDict> QCateList = ViewBag.QCateList;
                    foreach (var qCate in QCateList)
                    {
                    <li><a @if (i == 0)
                           {
                               @MvcHtmlString.Create("class=\"active\"")
                           } cateNo="@qCate["CATE_NO"]">@qCate["CATE_NAME"] <strong>(@qCate["QCOUNT"])</strong></a></li>
                           i++;
                    }
                }
            </ul>
        </div>
        @*试题*@
        <div class="con_st">
        </div>
    </div>
</div>
@section script
{

    <script src="@Url.Content("~/Scripts/plugins/bootstrap-paginator.min.js")"></script>
    <script src="@Url.Content("~/Scripts/plugins/jquery.grid.js")"></script>

    <script type="text/javascript">

        $(function() {
            loadData($(".list-inline li a").eq(0).attr("cateNo"));

            $(".list-inline li a").click(function() {
                $(".list-inline li a").removeClass("active");
                $(this).addClass("active");
                loadData($(this).attr("cateNo"));
            });


        });

        function closeWin() {
            mainfn.window('close');
            location.reload();
        }

        function loadData(cateNo) {
            $(".con_st").load("/testCenter/GetQuestionList?testId=@ViewBag.TestID&cateNo=" + cateNo, function () {
                var arrStr = document.cookie.split("; ");
                for (var i = 0; i < arrStr.length; i++) {
                    var temp = arrStr[i].split("=");
                    if (temp[0] == "curPosition")
                    Top_AppointPosition(parseInt(temp[1]));
                }
                //删除cookie
                var date = new Date();
                date.setTime(date.getTime() - 10000);
                document.cookie = "curPosition=1; expires=" + date.toGMTString();
            });
        }

        function Top_AppointPosition(qIndex) {
            var scrollOffSet = $("#q_" + qIndex).offset();  
            if (scrollOffSet != undefined) {
                $("body, html").animate({
                    scrollTop: scrollOffSet.top 
                }, 0);
            }
        }
    </script>
}
@section css
{
    <style>
        .div_Content
        {
            border: 1px solid #ddd;
            border-radius: 4px 4px 0 0;
            box-shadow: none;
            padding: 5px;
        }

        .page-header
        {
            margin: 0;
            border-bottom: 1px solid #ddd;
        }

        .div_content_header
        {
            margin-top: 15px;
            border-bottom: 1px solid #ddd;
        }

        .list-inline li
        {
            cursor: pointer;
        }


            .list-inline li a
            {
                display: block;
                margin: 0 15px;
                padding: 5px 15px;
                color: #8a959e;
                font-size: 16px;
                height: 30px;
                text-decoration: none;
            }

                .list-inline li a.active
                {
                    border-bottom: solid 3px #d84c31 !important;
                    color: #323a45;
                    cursor: default;
                }

                .list-inline li a:hover
                {
                    border-bottom: solid 3px rgba(216, 76, 49, 0.4);
                    color: #323a45;
                }

        .con_st
        {
            width: 100%;
        }

        .con_stAll
        {
            width: 100%;
            border-bottom: solid 1px #dadada;
            overflow: hidden;
            padding: 10px;
        }

        .con_stAll_tg
        {
            width: 100%;
            overflow: hidden;
            border-bottom: dashed #dadada 1px;
        }

            .con_stAll_tg span, .con_stAll_tg p
            {
                font-size: 14px;
                color: #333;
            }

        .con_stAll_da
        {
            width: 100%;
            _width: 100%;
            padding-top: 13px;
            overflow: hidden;
            position: relative;
        }

            .con_stAll_da label
            {
                width: 61px;
                height: 25px;
                float: left;
                background: url(../Content/images/radioBtn.jpg) no-repeat;
                line-height: 25px;
                text-align: center;
                padding-left: 23px;
                margin-right: 18px;
                overflow: hidden;
                display: inline;
            }

            .con_stAll_da .label_bj
            {
                background: url(../Content/images/radioBtn.jpg) 0 -25px no-repeat;
                color: #fff;
            }

        .panel-body
        {
            padding-left: 0;
        }
    </style>

}